package leetcode_数与位._01数字的位操作;

/**
 * @author yzh
 * @data 2021/3/24 19:55
 * 丑数
 */
public class _263_丑数 {
    public static void main(String[] args) {
        System.out.println(new _263_丑数().isUgly(10));
    }

    public boolean isUgly(int n) {
        if (n <= 1) return false;
        while (n % 5 == 0) n /= 5;
        while (n % 3 == 0) n /= 3;
        while (n % 2 == 0) n /= 2;
        return n == 1;
    }
}
